feat(breadcrumb)!: spectrum 2 migration#3395
Conversation
🦋 Changeset detectedLatest commit: 0fe2a32 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
88c8ac3 to
a819f2b
Compare
File metricsSummaryTotal size: 2.22 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
Detailsbreadcrumb
* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
|
🚀 Deployed on https://pr-3395--spectrum-css.netlify.app |
rise-erpelding
left a comment
There was a problem hiding this comment.
This looks really good! I only have a few small suggestions within the comments.
Also wondering: are the medium and large for breadcrumbs intended to be variants or t-shirt sizes? Is there some specific guidance somewhere that states that they can't or shouldn't be t-shirt sizes? I think the token specs make them seem more like variants, but the S2/Desktop spec makes them feel a bit more t-shirt size-like. It seems like, especially since --medium and --large are also used for specifying device size, it would be easier and less confusing to name them with the same conventions for t-shirt sizing, and that a future version of the component might follow t-shirt sizing even if this one doesn't. Thoughts?
| --spectrum-breadcrumbs-separator-spacing-inline: var(--spectrum-breadcrumbs-text-to-separator-multiline); | ||
| --spectrum-breadcrumbs-text-spacing-block-start: var(--spectrum-breadcrumbs-top-to-text-multiline); | ||
| --spectrum-breadcrumbs-text-spacing-block-end: var(--spectrum-breadcrumbs-top-text-to-bottom-text); | ||
| --spectrum-breadcrumbs-icon-spacing-block: var(--spectrum-breadcrumbs-top-to-separator-multiline) var(--spectrum-breadcrumbs-separator-to-bottom-text-multiline); |
There was a problem hiding this comment.
Do you think it's worth splitting --spectrum-breadcrumbs-icon-spacing-block into --spectrum-breadcrumbs-icon-spacing-block-start and --spectrum-breadcrumbs-icon-spacing-block-end versus setting them both in one like this? Same question for --spectrum-breadcrumbs-action-button-spacing-block.
cdb180d to
27d01df
Compare
74ba42e to
402c6c6
Compare
I've gone ahead and moved things around so large is now |
|
There are two things that I'd like to get answers on before re-review:
|
fc916f1 to
9d7f088
Compare
0a56d2b to
5ec2c31
Compare
marissahuysentruyt
left a comment
There was a problem hiding this comment.
This first pass was just TODOs now that spectrum-two got its mega-update (I know we're waiting on some fixes and questions before another deep review). Looks like we can probably refactor in a couple places to use Container and size.
5ec2c31 to
5dd5dcc
Compare
The args for action button sizing are now updated to work with the change in variants, so s = multiline, m = size medium, l = size large.
Yes, good idea. I removed that by adding
This now has its own test. Comments here on Marissa'a similar suggestion.
That was already something I confirmed with design about and they provided guidance on the dragged background color (some notes in PR description). I pinged them again to ask about adding this to the spec, as this will help with reviewing and comparing.
I don't think we need to show this on the Docs page in most cases, since we're using a storybook-only test class for VRT testing purposes for some of these interactions like focus, hover, active, etc. That could be a little confusing for referencing the markup to see a class not included in the CSS and it is not totally accurate in all cases. I don't see most button-like and form components Docs showing this currently. I think Textfield is one of the exceptions, since the docs were necessary to avoid some historical confusion and also show the quiet/non-quiet difference. |
50fbb69 to
aae0a89
Compare
There was a problem hiding this comment.
This update addresses all the things I'd noticed before!
I did notice one very minor thing by accident, because I had previously been checking cjk on another PR and had the locale flipped to Japan already:
When I switch to a cjk language, the multiline test/story with all the different-sized headings, it looks like the font size for .spectrum-Heading--sizeX shrinks a bit. There's no font-size adjustment for .spectrum-Breadcrumbs-item for cjk though so this font size stays the same. That makes it so that if no heading size is specified, the default heading size no longer matches any of the size options, if that makes sense. Basically, every single one of the current items in this screen shot has a different font for cjk (which you can kind of see visually if you look closely), instead of the default heading size always keeping pace with the large. The default with no heading size specified is 28px while the large is 25px. (It's also rendering different font stacks.)

I'm unsure if this is something that we can/should fix or whether maybe cjk was left out of the design for this? So I'll leave it to your discretion if it's something that needs to be addressed here and won't let it block my approval!
|
Re: the CJK comments, Breadcrumbs does not have CJK styles defined in the spec, while the Heading component does. I've created a followup issue CSS-1113 to track, and started a conversation with the design team. Also, about the "breadcrumb" vs "breadcrumbs" component naming, I found the existing issue CSS-1080; that would definitely be separate work as that will affect a lot of things. |
marissahuysentruyt
left a comment
There was a problem hiding this comment.
This is looking good to me- thanks for addressing all of my comments!
Just a quick (non-blocking) question- how did you know what version to bump the breadcrumbs tokens? or did that update happen in the rebase (that's sort of what I'm thinking)?
aae0a89 to
4a56be2
Compare
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
4a56be2 to
0fe2a32
Compare
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests
Migrates component to Spectrum 2. Includes renaming of variants and new large t-shirt size, changed token usage to match spec, additional storybook options, etc. docs(breadcrumb): new controls for nested and improved nested docs Adds controls so a user is able to display the nested truncated menu, root context, set disabled items, and item text. This also clears up and moves around some of the documentation about the truncated menu and root context. docs(breadcrumb): refactor tests Update VRTs tests file to use new refactored controls and updated s2 variants. More options can now live in the state data. docs(breadcrumb): add hover and focus-visible to tests

Description
Breadcrumbs Spectrum 2 Migration
The breadcrumbs component is now updated to use the S2 specs and tokens. This includes updated spacing, heights, colors, font sizes, etc. This does not currently include the updated S2 icons.
There has been a major design change to the variant classes related to density and sizing, to align their terminology better with t-shirt sizes:
spectrum-Breadcrumbs--compactclass and associated custom properties are removed. The default (medium) breadcrumbs are now sized similar to what was previously called compact.spectrum-Breadcrumbs--sizeLclass. This is sized similarly to what was previously the default.The breadcrumb title can now be customized in the multiline variant using an additional element that uses the typography component's heading classes. This and its preferred sizing have been added to the documentation, a new Docs example, and a new Storybook control
titleHeadingSize. Design notes for reference:The component has been refactored to slim down and simplify its CSS and custom properties, by changing the values of existing custom properties for large and multiline variants.
The drag and drop class has been better documented, and its class now has a background color using drop zone tokens for now per design feedback: "Those two use cases are essentially one in the same, as the breadcrumb item becomes a "drop zone" for that interaction."
The following mod custom properties have been removed:
--mod-breadcrumbs-action-button-spacing-block-between-multiline--mod-breadcrumbs-action-button-spacing-block-compact--mod-breadcrumbs-action-button-spacing-block-multiline--mod-breadcrumbs-block-size-compact--mod-breadcrumbs-block-size-multiline--mod-breadcrumbs-font-family-compact--mod-breadcrumbs-font-family-compact-current--mod-breadcrumbs-font-family-multiline--mod-breadcrumbs-font-family-multiline-current--mod-breadcrumbs-font-size-compact--mod-breadcrumbs-font-size-compact-current--mod-breadcrumbs-font-size-multiline--mod-breadcrumbs-font-size-multiline-current--mod-breadcrumbs-font-weight-compact--mod-breadcrumbs-font-weight-compact-current--mod-breadcrumbs-font-weight-multiline--mod-breadcrumbs-font-weight-multiline-current--mod-breadcrumbs-icon-spacing-block-between-multiline--mod-breadcrumbs-icon-spacing-block-compact--mod-breadcrumbs-icon-spacing-block-start-multiline--mod-breadcrumbs-text-spacing-block-between-multiline--mod-breadcrumbs-text-spacing-block-end-compact--mod-breadcrumbs-text-spacing-block-end-multiline--mod-breadcrumbs-text-spacing-block-start-compact--mod-breadcrumbs-text-spacing-block-start-multilineThe following mod custom properties have been renamed:
--spectrum-breadcrumbs-action-button-spacing-inline-startis now--spectrum-breadcrumbs-inline-start-to-truncated-menuto help clarify what it is used for. The general action button inline spacing is already handled by--mod-breadcrumbs-action-button-spacing-inline.CSS-811
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
titleHeadingSizeworks as expected and documentation around this is clearRegression testing
Validate:
To-do list